<template>
	<view class="nav-bar">
		<view class="container">
			<view class="statusBar" :style="{height:getStatusBarHeight()+'px'}"></view>
			<view class="title" :style="{height:getTitleBarHeight()+'px',marginLeft:getLeftIconLeft()+'px'}">
				{{title}}
			</view>
		</view>
		<view class="fill" :style="{height:getNavBarHeight()+'px'}"></view>
	</view>
</template>

<script setup>
	import {
		getStatusBarHeight,
		getTitleBarHeight,
		getNavBarHeight,
		getLeftIconLeft
	} from "@/utils/system.js"
	defineProps({
		title: {
			type: String,
			default: '首页'
		}
	})
</script>

<style lang="scss" scoped>
	.nav-bar {
		.container {
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
			z-index: 10;
			background: #191919;

			.title {
				font-size: 32rpx;
				font-weight: 500;
				color: #fff;
				width: 100%;
				height: 100%;
				display: flex;
				justify-content: center;
				align-items: center;
			}
		}
	}
</style>